//
//  GlobalDefine.h
//  OCDemo
//
//  Created by BH on 15/10/14.
//  Copyright © 2015年 baohan. All rights reserved.
//

#ifndef GlobalDefine_h
#define GlobalDefine_h

#define SCREEN_W [UIScreen mainScreen].bounds.size.width
#define SCREEN_H [UIScreen mainScreen].bounds.size.height

// 获取RGB颜色
#define ColorRGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]
#define ColorRGB(r,g,b) ColorRGBA(r,g,b,1.0f)

//获取提示信息
#define TIPS [NSString stringWithFormat:@"Click\nlinkType:%ld\nlinkText:%@\nlinkValue:%@",link.linkType,linkText,link.linkValue]
#define SHOW_SIMPLE_TIPS(m) [[[UIAlertView alloc] initWithTitle:@"" message:(m) delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]show]

//强制转换
#define LABEL ((MLLinkLabel *)self.label)

//controller来自storyboard
#define CONTROLLER_FROM_STORYBOARD(c) [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:(c)]

//navigation push
#define PUSH(p) [self.navigationController pushViewController:(p) animated:YES]

//获取沙盒目录
#define DOMAIN_PATH [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]

#endif /* GlobalDefine_h */
